package src.Skills;

import src.Main;
import src.Players.*;
import src.Packets.*;
import src.Util.Timer;

public class Fletching {
	private int fletchXPRate = 1;
	private Player p;
	private ItemOnItem ioi;
	
	public Fletching(Player _p) {
		p = _p;
	}
	
	public void fletchLog(int usedWith) {
        if(p == null)
        {
            return;
        }
        if(p.canWalkDelay > 0)
        {
            return;
        }
        int slot = 0;
        int fletchLvl = p.skillLvl[12];
        PlayerChecks pc = new PlayerChecks(p);
        if(!pc.playerHasItem(p, 946)) {
        	p.frame.sendMessage(p, "You need a knife to fletch logs!");
        	return;
        }
        switch(usedWith) {
        	case 1511:
				if(fletchLvl < 1) {
                    p.frame.sendMessage(p, "You need at least 1 Fletching to fletch this.");
                    break;
				} else {
					p.frame.showInterface(p, 303);
				}
			break;
        	
        	case 1521:
        		p.frame.sendMessage(p, "oak");
        	break;
        	
        	case 1519:
        		p.frame.sendMessage(p, "willow");
        	break;
        	
        	case 1517:
        		p.frame.sendMessage(p, "maple");
        	break;
        	
        	case 1515:
        		p.frame.sendMessage(p, "yew");
        	break;
        	
        	case 1513:
        		p.frame.sendMessage(p, "magic");
        	break;
    
        	default:
        		Main.m.log("[" + p.playerIndex + "-" + p.username + "] Unable to fletch");
        	break;
        }
	}

	private int random(int range)
	{
		return (int)(Math.random() * range);
	}
}